﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;

namespace ServicioLugares
{
    [DataContract]
    public class PlaceDetailReference
    {
        [DataMember(Name = "html_attributions")]
        public string HtmlAttributions { get; set; }
        [DataMember(Name = "result")]
        public CResult Result { get; set; }

        [DataContract]
        public class CResult
        {
            [DataMember(Name = "address_components")]
            public CAdressComponent[] AdressComponents { get; set; }

            [DataMember(Name = "reviews")]
            public CReview[] Reviews { get; set; }

            [DataContract]
            public class CAdressComponent
            {
                [DataMember(Name = "long_name")]
                public string LongName { get; set; }

                [DataMember(Name = "short_name")]
                public string ShortName { get; set; }

                [DataMember(Name = "types")]
                public string[] Types { get; set; }
            }

            [DataMember(Name = "formatted_address")]
            public string Address { get; set; }

            [DataMember(Name = "formatted_phone_number")]
            public string PhoneNumber { get; set; }

            [DataMember(Name = "geometry")]
            public CGeometry Geometry { get; set; }

            [DataContract]
            public class CGeometry
            {
                [DataMember(Name = "location")]
                public CLocation Location { get; set; }

                [DataContract]
                public class CLocation
                {
                    [DataMember(Name = "lat")]
                    public double Lat { get; set; }
                    [DataMember(Name = "lng")]
                    public double Lng { get; set; }
                }
            }

            [DataMember(Name = "icon")]
            public string Icon { get; set; }

            [DataMember(Name = "id")]
            public string Id { get; set; }

            [DataMember(Name = "international_phone_number")]
            public string InternationalPhoneNumber { get; set; }
            
            [DataMember(Name = "name")]
            public string Name { get; set; }

            [DataMember(Name = "rating")]
            public double Rating { get; set; }

            [DataMember(Name = "reference")]
            public string Reference { get; set; }

            [DataContract]
            public class CReview
            {
                [DataMember(Name = "aspects")]
                public CAspect[] Aspects { get; set; }

                [DataContract]
                public class CAspect
                {
                    [DataMember(Name = "rating")]
                    public double Rating { get; set; }
                    [DataMember(Name = "type")]
                    public string Type { get; set; }
                }

                [DataMember(Name = "author_name")]
                public string AthorName { get; set; }

                [DataMember(Name = "text")]
                public string Text { get; set; }

                [DataMember(Name = "time")]
                public long Time { get; set; }
            }

            [DataMember(Name = "types")]
            public string[] Types { get; set; }

            [DataMember(Name = "url")]
            public string Url { get; set; }

            [DataMember(Name = "vicinity")]
            public string Vicinity { get; set; }
        }

        [DataMember(Name = "status")]
        public string Status { get; set; }
    }
}